import AbilityStage from '@ohos.app.ability.AbilityStage'
import { Configuration } from '@ohos.app.ability.Configuration'
import AbilityConstant from '@ohos.app.ability.AbilityConstant'
import Want from '@ohos.app.ability.Want'

export default class NewsAbilityStage extends AbilityStage {
  static readonly TAG = "NewsAbilityStage"

  onCreate() {
    console.debug(`打印 -------- ${NewsAbilityStage.TAG}  ------ onCreate`)
  }

  onConfigurationUpdate(config) {
    console.debug(`打印 -------- ${NewsAbilityStage.TAG}  ------ onConfigurationUpdate
    config colorMode: ${config.colorMode} direction: ${config.direction}
     language: ${config.language}  screenDensity: ${config.screenDensity}
      displayId: ${config.displayId} `)
  }

  onMemoryLevel(level: AbilityConstant.MemoryLevel) {
    if (level.valueOf() > 0) {
      console.debug(`打印 -------- ${NewsAbilityStage.TAG}  ------ onMemoryLevel :${level.toString()}`)
    }
  }

  onAcceptWant(want: Want): string {
    console.debug(`打印 -------- ${NewsAbilityStage.TAG}  ------ onAcceptWant ${want.abilityName}`)
    return "NewsAbilityStage"
  }
}
